package componentes;

import java.util.EnumSet;
import java.util.List;

import model.Bet;
import model.BetStatus;
import model.Role;


public class BetManager {

	private BetsListsHelper betsListsHelper;


	public List<Bet> getBetListByStatusAndRole(EnumSet<BetStatus> statusList,EnumSet<Role> roleList ){
		EnumSetAndBetFilterPair<BetStatus> statusAndFilter = new EnumSetAndBetFilterPair<BetStatus>(statusList, new StatusBetFilter()); 
		EnumSetAndBetFilterPair<Role> roleAndFilter = new EnumSetAndBetFilterPair<Role>(roleList, new RoleBetFilter());
		betsListsHelper = new BetsListsHelper();
		return betsListsHelper.query(statusAndFilter, roleAndFilter);
	} 
	
	//Activate getBetListByStatusAndRole with StatusList and ALL Roles 
	public List<Bet> getBetListByStatus(EnumSet<BetStatus> statusList){
		return getBetListByStatusAndRole(statusList,EnumSet.allOf(Role.class));
	}

	//Activate getBetListByStatusAndRole with RoleList and ALL BetStatus 
	public List<Bet> getBetListByRole(EnumSet<Role> roleList){
		return getBetListByStatusAndRole(EnumSet.allOf(BetStatus.class),roleList);
	}

	

	public BetsListsHelper getBetsListsHelper() {
		return betsListsHelper;
	}

	public void setBetsListsHelper(BetsListsHelper betsListsHelper) {
		this.betsListsHelper = betsListsHelper;
	} 






}
